﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using PPIDataAccess.General;

namespace PPIDataAccess.Data
{
    public class DCentralOffice
    {
        public static DataSet SelectAll(string connection)
        {
            SqlDataAdapter _Da = null;
            try
            {
                _Da = new SqlDataAdapter("up_CentralOffices_SelectAll", DBHelper.GetConnection(connection));
                _Da.SelectCommand.CommandType = CommandType.StoredProcedure;
                DataSet _Ds = new DataSet();
                _Da.Fill(_Ds);
                return _Ds;
            }
            catch (Exception _Ex)
            {
                throw new Exception("Error executing up_CentralOffices_SelectAll", _Ex);
            }
            finally
            {
                if (_Da != null) _Da.SelectCommand.Connection.Close();
            }


        }

    }
}
